<extend name="Public:User/base"/>
<block name="content">
        <!-- btn-group start -->
    <div class="my-cols-right info-back-color back-margin-padding col-sm-9 col-lg-9">

        <div class="row">
            <div class="small-search col-sm-12 col-lg-12">
                <!-- todo 这个地方的列数相加大于12 -->
                <!-- row-search start -->
                <div class="row">
                    <div class="small-search-a col-sm-2 col-lg-2 text-center">
                        <a class="collect-btn" style="color: RGB(244,166,36)" href="#addressManage">地址管理</a>
                    </div>
                </div>
                <!--row-search end-->
            </div>
        </div>

        <div class="row" style="margin-left: 30px; margin-top: 50px;">
            <div class="col-lg-12 col-sm-12">
                <!-- todo 缺个三级联动【by:黄金宏】 -->

                <table width="95%" style="font-size: 14px;">
                    <tbody>

                    <foreach name="AddressInfo" item="v">
                    <tr class="table-row">
                        <td>{$v['zipcode']}</td>
                        <td>{$v['address']}</td>
                        <td>{$v['consignee']} {$v['contactphone']}</td>
                        <td>
                            <input type="hidden" value={$v['id']}>
                            <button  type="button" class="btn-text" data-toggle="modal" data-target="#myModal">
                                修改
                            </button>
                            <button class="btn-text" onclick="window.location.href ='{:U('Home/ShippingAddress/deleteAddress?addressId='.$v['id'])}' ">删除</button>
                            <if condition="$v['isdefault'] eq 1">
                            <button class="btn-text">默认地址</button></td>
                            <else/>
                            <button class="btn-text" onclick="window.location.href ='{:U('Home/ShippingAddress/setDefaultAddress?id='.$v['id'])}' ">设为默认</button></td>
                            </if>
                    </tr>
                    <tr class="black-row"><td colspan="7"></td></tr>
                    </foreach>

                    </tbody>
                </table>

                <br>
                <button  type="button" class="btn my-btn-default-bgcolor my-btn-default-text" data-toggle="modal" data-target="#myModal">
                    添加地址
                </button>
            </div>
        </div>

        <!-- Modal start-->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">填写地址信息</h4>
                    </div><br>
                    <!-- form start -->
                    <form class="form-horizontal" style="" action="__SELF__" method="POST">
                        <input type="hidden" name="addressId" value="">
                        <div class="form-group">
                            <label for="address" class="col-sm-3 control-label">详细地址</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="address" placeholder="填写详细地址" name="address">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="codezip" class="col-sm-3 control-label">邮政编码</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="codezip" placeholder="填写邮政编码" name="zipCode">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="name" class="col-sm-3 control-label">收货人姓名</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="name" placeholder="收货人姓名" name="consignee">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="phone" class="col-sm-3 control-label">联系方式</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="phone" placeholder="填写收件人电话" name="contactPhone">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-2">
                                <button type="reset" class="btn btn-primary">重置</button>
                            </div>
                            <div class="col-sm-offset-1 col-sm-2">
                                <button type="submit" class="btn btn-default my-btn-default-text">确认</button>
                                <!--<input class="btn my-btn-default-text btn-default btn-lg btn-block" type="submit" value="确认">-->
                            </div>
                        </div>
                    </form>
                    <!--form end -->
                </div>
            </div>
        </div>
        <!-- modal end-->
    </div>
  </block>